/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.andrawid;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

/**
 *
 * @author Cx
 */
public class MainActivity extends Activity implements OnClickListener {

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        setContentView(R.layout.main);

        // Set up click listeners for all the buttons

        View newButton = findViewById(R.id.new_button);
        newButton.setOnClickListener(this);
        View continueButton = findViewById(R.id.continue_button);
        continueButton.setOnClickListener(this);
        View aboutButton = findViewById(R.id.about_button);
        aboutButton.setOnClickListener(this);
        View collectionButton = findViewById(R.id.collection_button);
        collectionButton.setOnClickListener(this);



    }

    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.collection_button:
                
                break;

            case R.id.about_button:
                String s = getString(R.string.about_text);
                new AlertDialog.Builder(MainActivity.this).setTitle("About").setMessage("" + s).setNeutralButton("Close",
                        new DialogInterface.OnClickListener() {

                            public void onClick(DialogInterface dlg, int sumthin) {
                                // do nothing – it will close on its own
                            }
                        }).show();
                break;
            case R.id.new_button:
                startNewGame() ;

                break;
            case R.id.continue_button:
               
                break;
        }
    }

    private void startNewGame() {

        //start map activity
        Intent intentToMap = new Intent(getApplicationContext(), GmapActivity.class);
        startActivity(intentToMap);


    }
    @Override
    protected void onResume() {
        super.onResume();

    }

    @Override
    protected void onPause() {
        super.onPause();

    }
}
